package com.GameComponent;

import com.Core.GameEngine;
import com.Triocean.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class SplashScreen extends Activity
{	@Override
	public void onCreate(Bundle savedInstanceState)
	{	super.onCreate(savedInstanceState);
		setContentView(R.layout.splash_screen);
		
		GameEngine.musicThread=new Thread()
		{	public void run()
			{	Intent titleMusic = new Intent(GameEngine.globalContext, BackgroundMusic.class);
				titleMusic.putExtra(GameEngine.songID, R.raw.titlesong);
				startService(titleMusic);
			}
		};
		GameEngine.musicThread.start();
		
		new Handler().postDelayed
		(	new Thread()
			{	@Override
				public void run()
				{	Intent titleScreen=new Intent(SplashScreen.this, TitleScreen.class);
					SplashScreen.this.startActivity(titleScreen);
					SplashScreen.this.finish();
					SplashScreen.this.overridePendingTransition(R.layout.fadein, R.layout.fadestill);
				}
			},
			GameEngine.SPLASH_SCREEN_TIME
		);
	}
}
